using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Viettel.VOFFICE.DAO.Models.Mapping
{
    public class TraceFlowMap : EntityTypeConfiguration<TraceFlow>
    {
        public TraceFlowMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Comment)
                .HasMaxLength(1000);

            // Table & Column Mappings
            this.ToTable("TraceFlow");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.FromUserId).HasColumnName("FromUserId");
            this.Property(t => t.ToUserId).HasColumnName("ToUserId");
            this.Property(t => t.FromNodeId).HasColumnName("FromNodeId");
            this.Property(t => t.ToNodeId).HasColumnName("ToNodeId");
            this.Property(t => t.SubmissionId).HasColumnName("SubmissionId");
            this.Property(t => t.IsSubmission).HasColumnName("IsSubmission");
            this.Property(t => t.DocId).HasColumnName("DocId");
            this.Property(t => t.FlowStatus).HasColumnName("FlowStatus");
            this.Property(t => t.DocStatus).HasColumnName("DocStatus");
            this.Property(t => t.MainExecutor).HasColumnName("MainExecutor");
            this.Property(t => t.CoExcutor).HasColumnName("CoExcutor");
            this.Property(t => t.ComingDate).HasColumnName("ComingDate");
            this.Property(t => t.Comment).HasColumnName("Comment");
            this.Property(t => t.StillKeep).HasColumnName("StillKeep");
            this.Property(t => t.TransferNext).HasColumnName("TransferNext");
            this.Property(t => t.TransferBack).HasColumnName("TransferBack");
            this.Property(t => t.IsRead).HasColumnName("IsRead");
            this.Property(t => t.UpdatedAt).HasColumnName("UpdatedAt");
            this.Property(t => t.CreatedAt).HasColumnName("CreatedAt");
        }
    }
}
